<?php

namespace app\Device\controller;

use plugin\saiadmin\basic\BaseController;
use support\Request;
use support\Response;
use think\facade\Db;
use support\Log;

/**
 * 测试管理控制器--设备端
 */
class TestController extends BaseController{


    public function __construct()
    {
        parent::__construct();
    }

    /**
     * 数据列表
     * @param Request $request
     * @return Response
     */
    public function index(Request $request): Response
    {
        $where = $request->more([
            ['title', ''],
            ['author', ''],
        ]);
        Log::info(json( $where) );
        $data  = Db::table('sa_article')->where('id', '>', 3)->select();
        Log::info( json(is_string($data) ));

        return $this->success($data );
    }

    public function unlogin(Request $request): Response
    {
        $where = $request->more([
            ['title', ''],
            ['author', ''],
        ]);
        return $this->success($where, "Device 数据上报");
    }

}